#! /bin/sh
# postinst script for klik
#
# see: dh_installdeb(1)

#set -e

rpm -q rpm >/dev/null 2>&1 && set configure # for RPMs made with "alien -vvrc"

case "$1" in
    configure)
# Sorry but I do think it's probably up to the distro/fuse packagers
#	. /usr/share/debconf/confmodule
#	db_get klikclient/fuseusers
#	if [ -n "$RET" ]; then
#		users=$RET
#		for user in $users ; do
#			groups $user | grep -q '\bfuse\b' || usermod -a -G fuse $user
#		done
#	fi
	[ -x "`which xdg-mime`" ] && xdg-mime install --novendor /usr/share/klik/cmg-mimetype.xml >/dev/null && xdg-mime install --novendor /usr/share/klik/recipe-mimetype.xml >/dev/null
	[ -x "`which xdg-icon-resource`" ] && xdg-icon-resource install --novendor --size 48 /usr/share/klik/application-x-extension-cmg.png >/dev/null
	[ -x "`which xdg-desktop-menu`" ] && xdg-desktop-menu install --novendor /usr/share/klik/klik.desktop >/dev/null
# lintian says this is useless
#	[ -e /usr/lib/kde3 ] && ldconfig -n /usr/lib/kde3 >/dev/null
# lintain says this (gconftool) must go!
	if [ -x "`which gconftool-2 2>/dev/null`" ]; then
		export GCONF_CONFIG_SOURCE=$(gconftool-2 --get-default-source)
		gconftool-2 --makefile-install-rule /usr/share/klik/cmg-gnome-thumbnail.schema >/dev/null
		gconftool-2 --makefile-install-rule /usr/share/klik/klik-protocol.schema >/dev/null
	fi
    ;;

    abort-upgrade|abort-remove|abort-deconfigure)

    ;;

    *)
        echo "postinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0


